/**
 * @param {string} allowed
 * @param {string[]} words
 * @return {number}
 */
 var countConsistentStrings = function(allowed, words) {
  const set = new Set()
  let res = 0
  for(const c of allowed){
    set.add(c)
  }

  for(let i=0;i<words.length;i++){
    let count = 0
    for(let j=0;j<words[i].length;j++){
      if(set.has(words[i][j])){
        count++
      }
    }
    if(count===words[i].length){
      res++
    }
  }
  return res
};